BUFFER = 100
def build_economy_with_army  
  if my_farmers.between? 160,200
    farm_max    
    create_army
  else  
    build_economy    
  end
end

def create_army
build_barrack
(my_resources - BUFFER / 30).times {create_warrior}
end

def can_attack?
  my_warriors > 20
end

def build_economy
  (my_resources/5).times {create_farmer}
  farm_max
end

def farm_max
  8.times {farm}
end

